#!/bin/bash

source ./common.sh
sql_dir="$dir/../2.init-database/$version/mysql/drop"

echo "脚本目录：$sql_dir"

files=(
"anvil.mysql.drop.basic.sql"
"anvil.mysql.drop.code.sql"
"anvil.mysql.drop.conn.sql"
"anvil.mysql.drop.data.sql"
"anvil.mysql.drop.job.sql"
"anvil.mysql.drop.mda.sql"
"anvil.mysql.drop.monitor.sql"
"anvil.mysql.drop.report.sql"
"anvil.mysql.drop.sample.sql"
"anvil.mysql.drop.uni.sql"
"anvil.mysql.drop.wf.sql"
)

# 使用for循环遍历数组
for file in "${files[@]}"; do
  # 执行脚本
  mysql --host=$mysql_host --port=$mysql_port --database=$mysql_db --user=$mysql_username --password=$mysql_password --verbose < "$sql_dir/$file"
done